package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//存放在springboot中的类必须要放在和启动类同一个目录或者子目录中
@Controller
@ResponseBody
//@PropertySource(value = "classpath:application.properies",encoding = "utf-8")
public class TestController {

    //使用自定义配置项/框架配置项
    @Value("${myimage.path}")
    private String myImage;

    @RequestMapping("/sayhi")
    public String sayHi(){
        return "hello，Spring Boot : "+myImage;
    }
}
